package com.top10.controller;

import com.top10.bean.ResponseBean;
import com.top10.utils.RandomUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 分享接口
 */
@RestController
@RequestMapping("/share")
public class ShareController {



	@PostMapping("/manager/getLink")
	public ResponseBean getLink(String uuid,String name){
		if(uuid == null){
			return ResponseBean.createError("你输入的uui参数为空");
		}
		if( name == null){
			return ResponseBean.createError("你输入的name参数为空");
		}
       String code=RandomUtils.getRandomStr();
	   String admin="【"+name+"】"+"["+"https://m.t10mall.com/goods.html?uuid="+uuid+"]"+"点击链接,再选择浏览器打开"+"≤"+code+"≥";
      return  ResponseBean.createSuccess().addData("admin",admin);
	}
}
